package com.sunnada.edu.system.upload.dao;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.springframework.stereotype.Repository;

import com.sunnada.edu.system.pub.dao.BaseDaoImpl;

@Repository
public class UploadDaoImpl extends BaseDaoImpl implements UploadDao {
	
	@Override
	public int getUploadCots(HashMap<String, String> params) {
		List list = selectList("upload_sqlmap.getUploadCots", params);
		if(list!=null&&list.size()>0){
			String cot = ((Map)list.get(0)).get("cot")+"";
			return Integer.valueOf(cot);
		}
		return 0;
	}

	@Override
	public List<?> findUpload(HashMap<String, String> params) {
		return selectList("upload_sqlmap.findUpload", params);
	}

	@Override
	public int uploadAdd(HashMap<String, String> params) {
		return insert("upload_sqlmap.uploadAdd",params);
	}

	@Override
	public List<?> findUploadById(HashMap<String, String> params) {
		return selectList("upload_sqlmap.findUploadById", params);
	}

	@Override
	public int uploadDel(HashMap<String, String> params) {
		return update("upload_sqlmap.uploadDel",params);
	}
}
